package com.pajk.user.dal.mapper;

import com.pajk.user.model.UserRelation;

import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

import javax.management.relation.Relation;

/**
 * @author Haomin Liu
 */
public interface UserRelationMapper {

    public List<UserRelation> getUserRelationByFollowerId(@Param("followerId")Long followerId);

    public List<UserRelation> getUserRelationByFolloweeId(@Param("followeeId")Long followeeId);

    public List<UserRelation> getFolloweesByFollowerId(@Param("followerId")Long followerId);

    public UserRelation getUserRelationByFollowerIdAndFolloweeId(@Param("followerId")Long followerId,
                                                                   @Param("followeeId")Long followeeId);

    public void insertUserRelation(UserRelation relation);

    public void updateUserRelation(Map<String, Object> params);

    public void deleteUserRelation(@Param("followerId")Long followerId, @Param("followeeId")Long followeeId);
    
    public List<UserRelation> getFolloweesByFollowerIdAndType(@Param("followerId")Long followerId, @Param("relationType")Integer relationType);
    
    public void insertUserRelations(List<UserRelation> relations);
    
    public void deleteUserRelationByFollowerId(@Param("followerId")Long followerId);
}
